package com.dldata.devtools30.repository.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

import javax.sql.DataSource;

@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true,exposeProxy = true)
public class DlNameParameterJdbcTemplate {
    
    
    @Bean("npJdbcTemplate")
    public NamedParameterJdbcTemplate createNamedParameterJdbcTemplate(@Autowired DataSource dataSource){
        NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
        namedParameterJdbcTemplate.setCacheLimit(3);
        return namedParameterJdbcTemplate;
    }
    
}
